package org.example.com.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
//四种方法传参
@RestController
@RequestMapping("/four")
public class fourController {
    //@GetMapping
    @RequestMapping(method = RequestMethod.GET)
    public String select(){
        return "select four";
    }
   // @RequestMapping(method = RequestMethod.POST)
    @PostMapping
    public String save(){
        return "save four";
    }
   // @RequestMapping(method = RequestMethod.PUT)
    @PutMapping
    public String update(){
        return "update four";
    }
    //@RequestMapping(method = RequestMethod.DELETE)
    @DeleteMapping
    public String delete(){
        return "delete four";
    }
    @GetMapping("/{id}")
    public String find(@PathVariable("id") int id){
        return "find four"+id;
    }
    @GetMapping("/{id}/{age}")
    public String find(@PathVariable("id") int id,@PathVariable("age") int age){
        return "find four"+id+""+age;
    }

}
